# 安装requests
# pip install requests


import requests
query= input("请输入要搜索的字符串：")
url = f"https://www.sogou.com/web?query={query}"
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
}
resp = requests.get(url=url, headers=headers)
print(resp.status_code)
print(resp.text)

with open("pachong.html", mode="w", encoding='utf-8') as f:
    f.write(resp.text)
